package com.yang.booking.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yang.booking.pojo.Appointment;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppointmentMapper extends BaseMapper<Appointment> {

//    @Select("select count(id) from appointment where beautician_id = #{staffId} where " +
//            "select repeatCount form (select count(id) repeatCount from appointment where group by user_id having beautician_id = #{staffId}) > 1")

    @Select("select count(id) from appointment where beautician_id = #{staffId} group by user_id")
    List<Integer> QueryStaffItemRepeatCount(String staffId);

}
